package com.base.core.utils;


import com.base.core.constant.Enums;

/**
 * @author zhaojiulin
 * @date 2020/2/27 14:42
 */
public class BaseException extends RuntimeException {

    private static final long serialVersionUID = -7034897190745766989L;

    private int code;

    private String message;
    public BaseException(String message){
      super(message);
      this.message = message;
    }

    public BaseException(Throwable e)
    {
        super(e.getMessage(), e);
    }

    public BaseException(Enums.ResponseStatus responseStatus){
        this.message = responseStatus.getDesc();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
